/*
 * DictionaryCommand.java
 *
 * Copyright(c) 2010
 * Michael Kroez
 * kroez@studiorutton.de
 *
 * All rights reserved.
 *
 * $Id$
 * 
 */

package de.studiorutton.gerengdic.history;

import de.studiorutton.gerengdic.dictionary.DictionaryActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class DictionaryCommand extends AbstractCommand implements ICommand {
	public static final int DICTIONARY_RUN = 20;
	private  final static String bundle_package = "de.studiorutton.gerengdic.dictionary";

	public final static String MY_SEARCH_STRING_KEY = bundle_package + "." + SEARCH_STRING_KEY;
	public final static String MY_SEARCH_LANG_KEY = bundle_package + "." + SEARCH_LANG_KEY;
	
	public DictionaryCommand(String searchString, int searchLang) {
		super(searchString, searchLang);		
	}

	public void execute(Activity activity) {
		Intent i = new Intent( activity.getApplicationContext(), DictionaryActivity.class );
		Bundle b = new Bundle();
		b.putString( bundle_package + "." + SEARCH_STRING_KEY, getSearchString());
		b.putInt( bundle_package + "." + SEARCH_LANG_KEY, getSearchLang());
		i.putExtras( b );
		activity.startActivityForResult( i, DICTIONARY_RUN );
	}

}
